import request from '@/utils/request';
import qs from "qs";

export async function queryRule(params) {
  const limit = params.pageSize;
  const page = params.current;
  const my_params = {
    limit: limit,
    page: page,
  };
  Object.assign(params, my_params);
  delete params.current;
  delete params.pageSize;
    return request('/settle/cents/page', {
      params:params,
      paramsSerializer: params => {
        return qs.stringify(params, { indices: false })
      }
    });
}
export async function queryStore(params) {
  return request('store/store/list', {
    params,
  });
}
export async function centsDetail(params) {
  const limit = params.pageSize;
  const page = params.current;
  const my_params = {
    limit: limit,
    page: page,
  };
  Object.assign(params, my_params);
  delete params.current;
  delete params.pageSize;
  return request('settle/cents/details/page', {
    params,
  });
}
export async function centsStores(params) {
  return request('settle/cents/centsStores', {
    params,
  });
}

export async function addCents(params) {
  return request(`/settle/cents/addCents`, {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
